import Vue from "vue";
import FastClick from "fastclick";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import "reset-css";
import "amfe-flexible";
import "./styles/reset.css";
import "./styles/common.css";
import "./icons";
import "./plugins/vant.js";
import echarts from "echarts";

//全局组件
import commonHeader from "./components/commonHeader";
import commonEmpty from "./components/empty";
import PullRefreshList from "./components/PullRefreshList";
import userAvater from "./components/userAvater";
Vue.component("common-empty", commonEmpty);
Vue.component("common-header", commonHeader);
Vue.component("pull-refresh-list", PullRefreshList);
Vue.component("user-avater", userAvater);
Vue.prototype.$echarts = echarts;
FastClick.attach(document.body);

Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");

String.prototype.toDate = function() {
  try {
    return new Date(this.replace(/[-]/g, "/"));
  } catch (e) {
    return new Date();
  }
};
